package com.sys.db.daoImpl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.sys.db.dao.UserInfoDao;
import com.sys.pojo.UserInfo;

public class UserInfoDaoImpl extends SqlMapClientDaoSupport implements UserInfoDao {

	public void delete(String userName) throws Exception {
		this.getSqlMapClientTemplate().delete("UserInfo.delete",userName);
	}

	public List findAll() throws Exception {
		List list=this.getSqlMapClientTemplate().queryForList("UserInfo.findAll");
		return list;
	}

	public UserInfo findByUserName(String userName) throws Exception {
		UserInfo ui=(UserInfo) this.getSqlMapClientTemplate().queryForObject("UserInfo.findByUserName",userName);
		return ui;
	}

	public void save(UserInfo userInfo) throws Exception {
		this.getSqlMapClientTemplate().insert("UserInfo.insert",userInfo);
		
	}

	public void update(UserInfo userInfo) throws Exception {
		this.getSqlMapClientTemplate().update("UserInfo.update",userInfo);
	}

	

}
